#pragma once
#include<string>
#include <interface/global_data_interface.h>
#include <interface/interface.h>
#include "afxwin.h"
#include <utility/AddressInfoHelper.h>
#include "Util/Singleton.h"
#include "afxcmn.h"
#include "dlg_page_detail_info.h"
#include "dlg_page_main_info.h"

class dlg_contact_detail : public CDialogBase
{
	DECLARE_DYNAMIC(dlg_contact_detail)
public:
	dlg_contact_detail(CWnd* pParent = NULL);
	virtual ~dlg_contact_detail();
	enum { IDD = IDD_CONTACT_DETAIL_DLG };
	DECLARE_MESSAGE_MAP()

protected:
	virtual void DoDataExchange(CDataExchange* pDX);
	virtual BOOL OnInitDialog();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual void OnCancel();
	afx_msg void OnClose();
	virtual void PostNcDestroy();
	afx_msg void OnBnClickedBtnSaveClose();
	afx_msg void OnBnClickedBtnSaveNew();
	afx_msg void OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult);
	
public:
	void dskin_window();
	void change_language();
	void init( int contact_id , int group_id );
	void init( CString nick_name, CString phone, int phone_type);
	void init( aot::data::icontact_info* contact_info, bool is_update=true );
	void clean_data();
	BOOL save_data();
	afx_msg void on_menu_notify( UINT menu_id );

private:
	int update_contact_id_;
	bool is_update_;
	CTabCtrl tab_ctrl_;
	dlg_page_main_info	dlg_page_main_info_;
	dlg_page_detail_info dlg_page_detail_info_;

	aot::data::icontact_op* db_contact_op_;
public:
	afx_msg void OnBnClickedBtnCancel();
	void set_window_pos();
};

extern dlg_contact_detail* g_dlg_contact_detail;

dlg_contact_detail* get_dlg_contact_detail();